import { createRouter, createWebHistory } from 'vue-router'
import Gass from '@/views/gass/index.vue'
import TabBar from '@/components/TabBar.vue'

const routes = [{
        path: '/',
        name: 'gass',
        components: {
            default: Gass,
            footer: TabBar
        }
    },
    {
        path: '/home',
        name: 'home',
        components: {
            default: () =>
                import ('../views/home/index.vue'),
            footer: TabBar
        }
    },
    {
        path: '/kind',
        name: 'kind',
        components: {
            default: () =>
                import ('../views/kind/index.vue'),
            footer: TabBar
        }
    },
    {
        path: '/cart',
        name: 'cart',
        components: {
            default: () =>
                import ('../views/cart/index.vue'),
            footer: TabBar
        }
    },
    {
        path: '/user',
        name: 'user',
        components: {
            default: () =>
                import ('../views/user/index.vue'),
            footer: TabBar
        }
    },
    {
        path: '/search',
        name: 'search',
        component: () =>
            import ('../views/search/search.vue')
    },
    {
        path: '/detail/:id',
        name: 'detail',
        component: () =>
            import ('../views/detail/detail.vue')
    },
    {
        path: '/login',
        name: 'login',
        component: () =>
            import ('../views/login/login.vue')
    },
    {
        path: '/register',
        name: 'register',
        component: () =>
            import ('../views/register/register.vue')
    }
]

const router = createRouter({
    history: createWebHistory(process.env.BASE_URL),
    routes
})

export default router